export const useDrawCalculate = (emberbox: any) => {
  const draw = () => {
    if (emberbox.current === null) return;
    emberbox.current.drawCalculate.draw_polygon();
  };
  const draw_line_string = () => {
    if (emberbox.current === null) return;
    emberbox.current.drawCalculate.draw_line_string();
  };
  const drwa_point = () => {
    if (emberbox.current === null) return;
    emberbox.current.drawCalculate.draw_point();
  };
  const select = () => {
    if (emberbox.current === null) return;
    emberbox.current.drawCalculate.simple_select();
  };
  const trash = () => {
    if (emberbox.current === null) return;
    emberbox.current.drawCalculate.delPolygonOrPoint();
  };

  return {
    draw,
    draw_line_string,
    drwa_point,
    select,
    trash,
  };
};
